package com.captjack.micro.dao.mongodb.repository;

import com.captjack.micro.dao.mongodb.entity.NewStock;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

/**
 * @author Capt Jack
 * @date 2018/2/9
 */
@Repository
public interface MongoHelloRepository extends MongoRepository<NewStock, String> {

    /**
     * 根据code分页查询
     *
     * @param code     code
     * @param pageable 分页接口
     * @return 查询结果
     */
    Page<NewStock> findAllByCode(String code, Pageable pageable);

    /**
     * 根据code删除记录
     *
     * @param code code
     * @return 删除记录数
     */
    long deleteNewStockByCode(String code);

}
